#include "MyString.h"
#include <iostream>
using namespace std;

int main(int argc, char **argv)
{
	MyString s = "hello";			//构造函数
	cout << "s: "<<s << endl;

	//MyString s1 = s;
	MyString s1(s);					//拷贝构造函数
	cout << "s1: " << s1 << endl;

	MyString s2;
	s2 = s1;						//赋值
	cout << "s2: " << s2 << endl;

	MyString s3 = " wrold";
	cout << "s3: " << s3 << endl;
	MyString s4 = s + s3;			//hello world
	cout << "s4: " << s4 << endl;

	MyString s5  = s4;
	s5 += s4;
	cout << "s5: " << s5 << endl;
	
	s5[5] = '*';

	for(int i = 0; i < s5.size(); i++){
		cout << s5[i] << " ";
	}
	cout << endl;
	return 0;
}
